<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>cookieDemo</title>
</head>
<body>

<%
    /*Cookie[] cookies = request.getCookies();
    if(cookies != null){
        for (Cookie cookie : cookies) {
            if(cookie.getName().equals("username")){
                pageContext.setAttribute("username", cookie.getValue());
            }
            if(cookie.getName().equals("password")){
                pageContext.setAttribute("password", cookie.getValue());
            }
        }
    }*/
%>

<form action="${pageContext.request.contextPath}/LoginServlet" method="post">
    用户名：<input type="text" name="username" value="${pageScope.username}"><br>
    密码：<input type="password" name="password" value="${pageScope.password}"><br>
    <input type="checkbox" name="rememberMe" value="rememberMe">记住用户名和密码<br>
    <input type="submit" value="登录"><br>
</form>

</body>
</html>
